<?php if(isset($items) && count($items)>0):?>
<div id="nav">
    <ul>
    <?php foreach($items as $i=>$item):?>

        <li class="<?=isset($item['active']) && $item['active']==true?'active':''?>">
            <span>
                <a href="<?=isset($item['url'])?$item['url']:''?>"><?=$item['label']?></a>
            </span>
            <?php if(isset($item['items']) && count($item['items'])>0):?>
            <div class="<?=isset($item['active']) && $item['active']==true?'subnav':'dropdown'?>">
                <ul>
                    <?php foreach($item['items'] as $t=>$subitem):?>
                    <li class="<?=isset($subitem['active']) && $subitem['active']==true?'active':''?>">                      
                            <a href="<?=isset($subitem['url'])?$subitem['url']:NULL?>"><?=$subitem['label']?></a>                     
                    </li>
                    <?php endforeach?>
                </ul>
            </div>
                
            <?php endif?>
        </li>

    <?php endforeach?>
    </ul>
</div>
<?php endif; ?>
